home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 13 April 1997
- // Author: gf
- //
- //
- // Procedure Name:
- // DynSettingsMenu
- //
- // Description:
- // Create the DYNAMICS->Settings menu
- //
- // Input Arguments:
- // parent to parent the menu to.
- //
- // Return Value:
- // None.
- //
-
- global proc DynSettingsMenu( string $parent )
- {
- setParent -menu $parent;
-
- menuItem -label "Initial State" -subMenu true initialStateMenu;
- menuItem -label "Set for Selected"
- -annotation "Set for Selected: Set initial state for the selected dynamic object"
- -command "saveInitialStateForSelected" saveState;
- menuItem -label "Set for All Dynamic"
- -annotation "Set for All Dynamic: Set initial state for all dynamics objects"
- -command "evalEcho saveInitialState -all" saveStateAll;
- setParent -menu ..;
- menuItem -divider true;
-
- menuItem -label "Rigid Body Solver..."
- -annotation "Rigid Body Solver: Display the Rigid Body Solver Editor"
- -command RigidBodySolver
- editRigidSolver;
-
- menuItem -divider true;
-
- string $menu = `menuItem -label "Current Rigid Solver"
- -subMenu true -tearOff false
- -annotation "Current Rigid Solver: Set the current rigid body solver"`;
- menuItem -edit -postMenuCommand ( "createRigidSolverList " + $menu ) $menu;
-
- setParent -menu ..;
-
- menuItem -label "Create Rigid Body Solver"
- -annotation "Create Rigid Body Solver: Creates a new rigid body solver and makes it current"
- -command "CreateRigidBodySolver"
- createRigidSolver;
-
- setParent -menu ..;
-
- menuItem -divider true;
-
- menuItem -label "Set Rigid Body Interpenetration"
- -annotation "Set Rigid Body Interpenetration: Allow selected rigid bodies to interpenetrate"
- -command "SetRigidBodyInterpenetration"
- rigidBodyInterpenetration;
-
- menuItem -label "Set Rigid Body Collision"
- -annotation "Set Rigid Body Collision: Allow selected rigid bodies to collide"
- -command "SetRigidBodyCollision"
- rigidBodyCollison;
-
- menuItem -divider true;
-
- menuItem -label "Memory Caching" -subMenu true sceneCaching;
- menuItem -label "Enable"
- -annotation "Enable Cache: Turn memory caching on for all selected particles and rigid bodies"
- -command "EnableMemoryCaching" enableCaching;
-
- menuItem -label "Disable"
- -annotation "Disable Cache: Turn memory caching off for all selected particles and rigid bodies"
- -command "DisableMemoryCaching" disableCaching;
-
- menuItem -divider true;
- menuItem -label "Delete"
- -annotation "Delete Cache: Remove from memory the cache for all selected particles and rigid bodies"
- -command "DeleteMemoryCaching" deleteCache;
- setParent -menu ..;
-
- menuItem -label "Create Particle Disk Cache"
- -annotation "Create Particle Disk Cache: Write cache files to disk for current playback range"
- -command "CreateParticleDiskCache"
- -dragMenuCommand "performDynamics 0 ParticleRenderCache 2"
- -image "bakeParticles.xpm"
- particleRenderCacheItem;
- menuItem -optionBox true
- -annotation "Particle Disk Cache Option Box"
- -label "Particle Disk Cache Option Box"
- -command "CreateParticleDiskCacheOptions"
- particleRenderCacheDialogItem;
-
- menuItem -divider true;
-
- menuItem -label "Edit Oversampling or Cache Settings..."
- -annotation "Edit the oversampling level or particle disk cache settings"
- -command "EditOversamplingForCacheSettings"
- editOversampling;
-
- setParent -menu ..;
-
- int $dynamicsIsLicensed = `licenseCheck -mode "edit" -type "fx"`;
- if (!$dynamicsIsLicensed)
- {
- menuItem -edit -enable false eventEdWinItem;
- menuItem -edit -enable false runupCacheMenu;
-
- // if it is desired to disable the particle render cache menu item
- // when there is no fx edit license, add that line here.
- }
- global float $dynMaxFloatField = 500000;
- global float $dynMinFloatField;
- $dynMinFloatField = -500000;
- }
-
-
- global proc string createRigidSolverList( string $parent )
- //
- {
- setParent -menu $parent;
- menu -edit -deleteAllItems $parent;
-
- int $i;
- string $solverList[] = `ls -type rigidSolver`;
- int $solverCount = size($solverList);
-
-
- radioMenuItemCollection;
- if ( $solverCount > 0 )
- {
- for ($i = 0; $i < $solverCount; $i++)
- {
- string $cmdString = "getAttr " + $solverList[$i] + ".current";
-
- int $current = eval( $cmdString );
-
- $cmdString = "setAttr " + $solverList[$i] + ".current 1";
-
- string $menu = "menu" + $solverList[$i];
-
- menuItem -label $solverList[$i] -radioButton $current -command $cmdString $menu;
- }
- }
- else
- {
- menuItem -label "No rigid solvers found";
- }
-
- return 1;
- }
-
- global proc callRunup()
- //
- // Call runup -cache and print message for user.
- //
- {
- evalEcho("runup -cache");
- print("// Runup and cache to current frame completed for all particles and rigid bodies.\n");
- }
-
- global proc callDynCache()
- //
- // Call dynCache and print message for user.
- //
- {
- evalEcho("dynCache");
- print("// Cached all particle and rigid body states for current frame.");
- }
-